home *** CD-ROM | disk | FTP | other *** search
/ No Fragments Archive 12: Textmags & Docs / nf_archive_12.iso / MAGS / SOURCES / ATARI_SRC.ZIP / atari source / AHDI / TTDRIVER / DOIT.S < prev    next >
Encoding:
Text File  |  2001-02-09  |  2.2 KB  |  118 lines

  1. ;+
  2. ; Edit History
  3. ;
  4. ; May-18-89    ml.    Started this.
  5. ; Aug-21-89    ml.    Added format code.
  6. ;-
  7.  
  8. .include    "defs.h"
  9.  
  10.  
  11. ;+
  12. ; doscmd() - send a simple command (no DMA involved)
  13. ;
  14. ; Passed:
  15. ;    d0.w = physical unit number
  16. ;    d2.w = command length (NCMD or LCMD)
  17. ;-
  18.     .globl    _doscmd
  19.     .extern    _smplacsi
  20.     .extern    _smplscsi
  21. _doscmd:
  22.     btst    #3,d0            ; SCSI unit?
  23.     bne.s    .0            ; if so, use the SCSI protocol
  24.     bsr    _smplacsi        ; else, use the ACSI protocol
  25.     bra.s    dosend
  26. .0:    bsr    _smplscsi
  27. dosend:    rts
  28.  
  29.  
  30. ;+
  31. ; dorcmd() - send a command which will receive data from the target
  32. ;
  33. ; Passed:
  34. ;    d0.w = physical unit number
  35. ;    d1.l = transfer length (in bytes)
  36. ;    d2.w = command length (NCMD or LCMD)
  37. ;    a0.l = buffer address
  38. ;-
  39.     .globl    _dorcmd
  40.     .extern    _rcvacsi
  41.     .extern    _rcvscsi
  42. _dorcmd:
  43.     btst    #3,d0            ; SCSI unit?
  44.     bne.s    .0            ; if so, use the SCSI protocol
  45.     bsr    _rcvacsi        ; else, use the ACSI protocol
  46.     bra.s    dorend
  47. .0:    bsr    _rcvscsi
  48. dorend:    rts
  49.  
  50.     
  51. ;+
  52. ; dowcmd() - send a command which will write data to the target
  53. ;
  54. ; Passed:
  55. ;    d0.w = physical unit number
  56. ;    d1.l = transfer length (in bytes)
  57. ;    d2.w = command length (NCMD or LCMD)
  58. ;    a0.l = buffer address
  59. ;-
  60.     .globl    _dowcmd
  61.     .extern    _wrtacsi
  62.     .extern    _wrtscsi
  63. _dowcmd:
  64.     btst    #3,d0            ; SCSI unit?
  65.     bne.s    .0            ; if so, use the SCSI protocol
  66.     bsr    _wrtacsi        ; else, use the ACSI protocol
  67.     bra.s    dowend
  68. .0:    bsr    _wrtscsi
  69. dowend:    rts
  70.  
  71.     
  72.  
  73. .if    !DRIVER                ; not to be included in driver
  74.  
  75. ;+
  76. ; doformat() - format unit
  77. ;
  78. ; Passed:
  79. ;    d0.w = physical unit number
  80. ;    d2.w = command length (NCMD or LCMD)
  81. ;-
  82.     .globl    _doformat
  83.     .extern    _fmtacsi
  84.     .extern    _fmtscsi
  85. _doformat:
  86.     btst    #3,d0            ; SCSI unit?
  87.     bne.s    .0            ; if so, use the SCSI protocol
  88.     bsr    _fmtacsi        ; else, use the ACSI protocol
  89.     bra.s    dofend
  90. .0:    bsr    _fmtscsi
  91. dofend:    rts
  92.  
  93.  
  94. ;+
  95. ; dostunit() - start or stop unit
  96. ;
  97. ; Passed:
  98. ;    d0.w = physical unit number
  99. ;    d2.w = command length (NCMD or LCMD)
  100. ;-
  101.     .globl    _dostunit
  102.     .extern    _stacsi
  103.     .extern    _stscsi
  104. _dostunit:
  105.     btst    #3,d0            ; SCSI unit?
  106.     bne.s    dostend            ; if so, use the SCSI protocol
  107. ;    bne.s    .0            ; if so, use the SCSI protocol
  108.     bsr    _stacsi            ; else, use the ACSI protocol
  109. ;    bra.s    dostend
  110. ;.0:    bsr    _stscsi
  111. dostend:
  112.     rts
  113.  
  114. .endif    ;!DRIVER
  115.  
  116.  
  117.  
  118.